﻿using System;
using System.Runtime.Serialization;

namespace VsxTools.Exceptions
{
    public sealed class WindowPaneNotFoundException : Exception
    {
        public WindowPaneNotFoundException(string message) : base(message)
        {
        }

        public WindowPaneNotFoundException(Type type) : base(MessageString(type))
        {
        }

        public WindowPaneNotFoundException(Type type, Exception innerException)
            : base(MessageString(type), innerException)
        {
        }

        public WindowPaneNotFoundException(string message, Exception innerException) : base(message, innerException)
        {
        }

        public WindowPaneNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }

        private static string MessageString(Type type)
        {
            return string.Format("Window pane based on type '{0}' cannot be found.", type);
        }
    }
}
